package junit.com.cpi.cornpp.common.files;

import java.util.ArrayList;
import java.util.List;

import com.cpi.cornpp.common.files.SAPComponentFile;
import com.cpi.cornpp.common.files.exception.SAPComponentFileException;

import junit.framework.TestCase;

public class SAPComponentFileTest extends TestCase {
	private SAPComponentFile sapComponentFile;
	//private final static String SAP_FILE_NAME_TEST = "Grind.txt";
	//private final static int OFF_SET_LINES_TEST = 1;
	private static final String FILE_EMPTY = "File is empty";
	public SAPComponentFileTest(String name) {
		super(name);
	}
	
	protected void setUp() throws Exception {
		/**
			public List parse(List list) throws SAPComponentFileException {
				return null;
			}
		};
		*/
	}

	protected void tearDown() throws Exception {
		sapComponentFile = null;
	}

	public void testExists() {
		boolean exists = false;
		try {
			exists = sapComponentFile.exists();
		} catch (SAPComponentFileException sapComponentFileException) {
			sapComponentFileException.printStackTrace();
		}
		assertTrue(exists);
	}

	public void testGetContent() {
		List list = null;
		try {
			list = new ArrayList(0);
			list = sapComponentFile.getContent();
			if( list.size() == 0 ){
				fail(FILE_EMPTY);
			}
		} catch (SAPComponentFileException sapComponentFileException) {
			sapComponentFileException.printStackTrace();
		}
	}
}